#! /bin/sh

for arg in "$@"
do
  case "$arg" in
    -help | --help | --hel | --he | -version | --version | --versio | --versi | --vers)
      quick_fwd=yes
     ;;
  esac
done

if test "x$quick_fwd" = xyes
then
  support/configure "$@"
else
  echo "retrieving the system name, type and OS release..."
  rev=`support/config.guess`
  if test "${rev}" 		# test for no output
  then
    # let SunOS chance to find sed etc
    case `uname` in
	SunOS)	PATH=/usr/sfw/bin:/usr/xpg4/bin:$PATH
		export PATH
	;;
	FreeBSD) echo_opt=-e
	;;
    esac
    echo "  your system seems to be ${rev}."
    if test ! -d "${rev}/."
    then
      echo "creating directory ${rev}..."
      mkdir "${rev}"
    fi
    cd "${rev}"
    echo "now working in directory ${rev}..."
    cp -p ../support/configure .
   if test ! -f config.h
   then
     echo "copying config.h from config.h.dist..."
     cp -p ../support/config.h.dist config.h
   fi
    sh configure "$@"
    if test $? = 0
    then
      echo $echo_opt "
******************************************************
Have you ever read \033[1mrusnet-doc/RUSNET_DOC\033[0m?
Do not proceed before thorough reading of this file.

Your next step is: 
cd ${rev}
edit \"config.h\" to fit your needs
run \"make\" to build and
run \"make install\" to install.

NOTE:
RusNet IRCD development team has made the most 
necessary changes to config.h. You might want to change
\033[1mUID/GID\033[0m and \033[1mMAXCONNECTIONS\033[0m only.

IT IS IMPERATIVE THAT YOU SHOULD READ 
\033[1mrusnet-doc/INSTALL\033[0m BEFORE RUNNING THE SERVER.
*******************************************************
"
    fi
  else
    echo Failed to determine your host type, giving up.
    echo Perhaps you should specify it manually.
  fi
fi
